package portal.web.servlets;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.swing.text.StyledEditorKit.ForegroundAction;

import portal.entidades.Configuracion;
import portal.web.delegate.IPortalWebDelegate;
import portal.web.delegate.PortalWebDelegate;

/**
 * Class that handles the delete company request
 */
@WebServlet("/Configuracion/ConfiguracionDelete")
public class ConfiguracionDelete extends HttpServlet {
	private static final long serialVersionUID = 1L;

	/**
	 * @see HttpServlet#HttpServlet()
	 */
	public ConfiguracionDelete() {
		super();
		// TODO Auto-generated constructor stub
	}

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		Long id = new Long(request.getParameter("id"));

		IPortalWebDelegate app = PortalWebDelegate.getInstanace();
		String message;
		try {
		
			app.borrarConfiguracion(id);
			
		} catch (Exception e) {
			response.getWriter()
			.print("Error - la configuracion no fue eliminada");
		}

	
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}
	
	

}
